<script>
export default {
  name: "LsdBtn",
  props: {
    btnData: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  methods: {},
  render(h) {
    return (
      this.btnData &&
      <el-button
        {...{
          class: {
            "el-button--img": this.btnData.img
          },
          style: {
            ...this.btnData.style
          },
          attrs: {
            ...this.btnData.attrs
          },
          on: {
            click: () => {
              this.$emit("click", this.btnData);
            }
          }
        }}
      >
        {
          this.btnData.img && <span class='button-inner' style='display: flex; align-items: center'>
            {this.btnData.img && <img src={this.btnData.img} />}
            {this.btnData.text}
          </span>
        }
        {
          !this.btnData.img && this.btnData.text
        }
      </el-button>
    );
  }
};
</script>

<style lang="less" scoped>
</style>
